<script>
    dojo.require("dijit.form.Button");
    dojo.require("dijit.form.Form");
    dojo.require("dijit.form.TextBox");
    dojo.require("dijit.form.SimpleTextarea");    
    dojo.require("dijit.form.ValidationTextBox");
    dojo.require("dijit.form.NumberTextBox");
    dojo.require("dijit.form.CurrencyTextBox");    
    dojo.require("dijit.form.ComboBox");     
    dojo.require("dijit.form.CheckBox");
    dojo.require("dijit.form.RadioButton");    
    dojo.require("dijit.form.DateTextBox");    			    
    
    dojo.require("dijit.Editor");
    dojo.require("dijit._editor.plugins.TabIndent");    
    dojo.require("dijit._editor.plugins.ViewSource");
    dojo.require("dojo.data.ItemFileReadStore");
</script>


<script>
    function sendForm(form_id) {
        var form = dojo.byId('form_' + form_id);
        dojo.connect(form, "onsubmit", function(event) {
            dojo.stopEvent(event);
            var xhrArgs = {
                url: '<? echo $ajax_link?>/do_create/'+form_id, 
                form: dojo.byId('form_' + form_id),
                //handleAs: "text",
                load: function(data) {
                    alert(data);
                    //dojo.byId("response").innerHTML = "Form posted.";
                },
                error: function(error) {
                    //We'll 404 in the demo, but that's okay.  We don't have a 'postIt' service on the
                    //docs server.
                    //dojo.byId("response").innerHTML = "Form posted.";
                }
            };             
            dojo.xhrPost(xhrArgs);
        });                      
    }
</script>

<?php foreach ($forms as $f):?>

<?php echo $f;?>

<?php endforeach;?>
      
</form>      